package com.algo.core.processor;

import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * 线程工厂
 */
public class ProcessorThreadFactory implements ThreadFactory {

    private AtomicInteger count = new AtomicInteger(1);

    @Override
    public Thread newThread(Runnable r) {
        Thread thread = new Thread(r);
        thread.setName("processor thread " + count.getAndIncrement());
        return thread;
    }

}
